#include "logger.h"
#include "persistance.h"
#include "persistent_data.h"

//USING_NAMESPACE_TANGRAM

void* PersistentData::operator new(std::size_t size) throw(std::bad_alloc)
{
	LOG_TRACE("allocate:%u", size);
	return ManagedMemory::Instance().allocate(size);
}

void PersistentData::operator delete(void *pMemory) throw()
{
	LOG_TRACE("deallocate");
	ManagedMemory::Instance().deallocate(pMemory);
}

void* PersistentData::operator new(std::size_t size, const std::nothrow_t& nt) throw()
{
	LOG_TRACE("allocate:%u", size);
	return ManagedMemory::Instance().allocate(size, nt);
}

void PersistentData::operator delete(void *pMemory, const std::nothrow_t&) throw()
{
	LOG_TRACE("deallocate");
	ManagedMemory::Instance().deallocate(pMemory);
}
